package com.ayu.envdemo.swagger;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import springfox.documentation.builders.ApiInfoBuilder;
import springfox.documentation.builders.PathSelectors;
import springfox.documentation.builders.RequestHandlerSelectors;
import springfox.documentation.spi.DocumentationType;
import springfox.documentation.spring.web.plugins.Docket;
import springfox.documentation.swagger2.annotations.EnableSwagger2WebMvc;

/**
 * @Author: 徐林玉//作者及
 * @Date: 2021/12/8//完成日期
 * @Description: //
 * @Version: v0.0.1 // 版本信息
 * @Function List: // 主要函数及其功能
 * @Others: // 其它内容的说明
 * @History: // 历史修改记录
 **/
@Configuration
@EnableSwagger2WebMvc
public class DeviceSwaggerConfig
{


	@Bean(value = "envdemo")
	public Docket envdemoapi() {
		return new Docket(DocumentationType.SWAGGER_2)
				.apiInfo(new ApiInfoBuilder()
								 //.title("swagger-bootstrap-ui-demo RESTful APIs")
								 .description("# swagger-bootstrap-ui-demo RESTful APIs")
								 .termsOfServiceUrl("http://www.xx.com/")
								 .contact("phoenixperson@qq.com")
								 .version("1.0")
								 .build())
				//分组名称
				.groupName("环境监测")
				.select()
				//这里指定Controller扫描包路径
				.apis(RequestHandlerSelectors.basePackage("com.ayu.envdemo.controller"))
				.paths(PathSelectors.any())
				.build();

	}
}
